// app/middleware/recordRequests.js
module.exports = () => {
  return async function recordRequests(ctx, next) {
    // 在这里记录请求信息
    const { method, url } = ctx.request;
    console.log(`*** HTTP ${method} request to ${url}`);
    ctx.app.iotLog.logger(`ELE HTTP ${method} request to ${url}`);
    // 继续处理后续中间件
    await next();
  };
};
